find-file
Search for a file in an array of paths using Node.js.
Getting started
Install with npm: npm install find-file
Examples
var findFile = require('find-file');
findFile('gifsicle', { path: ['vendor', '../bin'] });
findFile('gifsicle', { path: ['vendor', '../bin'], global: false });
findFile('gifsicle', { path: 'vendor' })[0];
API
findFile(name, opts)
Search for a file in an array of paths. By default it will also search for
files in PATH
.
Options
path
Type: String|Array
Default: undefined
Paths to search in.
exclude
Type: String|Array
Default: undefined
Paths to exclude.
global
Type: Boolean
Default: true
Whether to search in PATH
.
License
MIT License (c) Kevin Mårtensson